<template>
  <div>
    <!--列表-->
    <el-table
      ref="table"
      v-loading="tableLoad"
      :data="tableData"
      fit
      highlight-current-row
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" />
      <el-table-column prop="orderNum" label="委托单号" />
      <el-table-column prop="sampleNum" label="样品编号" />
      <el-table-column prop="sampleName" label="样品名称" />
      <el-table-column prop="sampleScrapCount" label="报废数量" />
      <el-table-column prop="sampleScrapDate" label="报废日期" />
      <el-table-column prop="sampleScrapType" label="报废类型" />
    </el-table>
  </div>
</template>
<script>
import { finishedGetList } from "../../../api/SampleManage/SampleScrap.js";
export default {
  name: "SampleScrapFinished",
  components: {},
  props: {
    filterForm: {
      type: Object,
      default: () => { },
    },
    pageInfo: {
      type: Object,
      default: () => { },
    },
  },
  data() {
    return {
      tableLoad: false,
      tableData: [],
      tableDatas: [],
    };
  },
  computed: {},
  created() {
    this.getList();
  },
  methods: {
    handleSelectionChange(val) {
      this.tableDatas = val;
    },
    getList(flag) {
      this.loading = true;
      finishedGetList({ ...this.filterForm, ...this.pageInfo })
        .then((res) => {
          this.tableData = res.data.dataList ? res.data.dataList : [];
          this.$emit("update:total", res.data.total);
          this.loading = false;
        })
        .catch(() => {
          this.loading = false;
        });
    },
  },
};
</script>
